<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title >流量记录-淘宝电商-电商ERP系统</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;">
    <style type="text/css">
        .update {
            display: inline-block;
            margin-left: 15px;
            padding: 0 20px;
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            background: #009789;
            color: #fff;
            text-align: center;
            border-radius: 3px;
            cursor: pointer;
        }

        .update i {
            display: inline-block;
            margin-right: 10px;
            vertical-align: middle;
            width: 30px;
            height: 30px;
            background: url();
        }

        .T-box {
            width: 400px;
            padding: 0 20px;
            text-align: left;
        }

        .T-box p {
            position: relative;
            height: 36px;
            line-height: 36px;
            font-size: 14px;
            margin-bottom: 15px;
        }

        .T-box p span {
            display: inline-block;
            padding-right: 15px;
            text-align: right;
            width: 110px;
            line-height: 36px;
            font-size: 14px;
        }

        .T-box p input, .T-box p select {
            width: 160px;
            padding: 0 5px;
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            border: 1px solid #d3d3d3;
            outline: none;
        }

        .T-box p i {
            padding: 0 10px;
            line-height: 36px;
            font-style: normal;
        }

        .T-box p b {
            display: inline-block;
            margin-left: 10px;
            cursor: pointer;
            width: 60px;
            height: 36px;
            line-height: 36px;
            background: #c33;
            color: #fff;
            text-align: center;
            font-size: 13px;
            font-weight: normal;
        }

        .T-result {
            margin-bottom: 0;
        }

        .T-result em {
            color: #c33;
            font-style: normal;
        }
    </style>
    <div class="layui-tab layui-tab-brief" lay-filter="demo">
        <ul class="layui-tab-title">
            <li ><a th:href="@{/tao/dashboard(shopId=${shopId})}">首页</a></li>
            <li><a th:href="@{/tao/order_list(shopId=${shopId})}">订单管理</a></li>
            <!-- <li><a th:href="@{/tao/order_create(shopId=${shopId})}">手动创建订单</a></li> -->
            <li><a th:href="@{/tao/refund_list(shopId=${shopId})}">退货管理</a></li>
            <li ><a th:href="@{/tao/goods_list(shopId=${shopId})}">商品管理</a></li>
            <li class="layui-this"><a th:href="@{/tao/goods_traffic_list(shopId=${shopId})}">商品流量管理</a></li>
            <li ><a th:href="@{/tao/goods_optimization_record(shopId=${shopId})}">商品优化记录</a></li>
        
        </ul>

    </div>

    <!-- content starts -->


    <fieldset class="layui-elem-field">
        <legend>按条件搜索</legend>
        <div class="layui-field-box">
            <form class="layui-form layui-form-pane1" method="get" action="/tao/goods_traffic_list">
                <input type="hidden" name="shopId" th:value="${shopId}"/>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <input type="text" autocomplete="off" name="keyword" th:value="${keyword}" placeholder="关键词" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="goodsId" th:value="${goodsId}" placeholder="商品id" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">日期</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="date" id="date" autocomplete="off"
                                 th:value="${date}"  style="width: 120px;" placeholder="yyyy-MM-dd">
                        </div>
  
                    </div>

                    <div class="layui-inline">
                        <button type="submit" class="layui-btn ">搜索</button>
                        <i>总共：<span style="color: red" th:text="${totalSize}"></span>条记录</i>
                    </div>
                    <div class="layui-inline">
                        <span id="add_keyword" class="layui-btn layui-btn-normal">添加商品流量来源</span>
                    </div>
                </div>

            </form>


        </div>
    </fieldset>


    <!-- start dd-wrapper -->
    <link rel="stylesheet" href="/goods/order.css"/>
    <div class="dd-wrapper">

<!--            <input type="hidden" name="shopId" th:value="${shop.id}">-->
<!--            <div class="layui-inline" style="padding-bottom: 10px;">-->
<!--                <input type="button" class="layui-btn layui-btn-primary" id="batch_set_order_type" th:attr="shop-id=${shop.id}" value="批量关联业务员(0)"/>-->
<!--            </div>-->

            <table class="dd-table">
                <tr>
                    <th>商品ID</th>
                    <th >商品</th>
                    <th>关键词</th>
                    <th >来源</th>
                    <th>访客数</th>
                    <th>日期</th>
                </tr>
                <tr th:each="item:${lists}">
                    <td>
                        <span th:text="${item.goodsId}"></span>
                    </td>
                    <td>
                        <div >
                            <img th:src="${item.goodsImg}">
                            <p><span th:text="${#strings.abbreviate(item.title,18)}"></span> </p>
                        </div>
                    </td>
                    <td>
                        <b th:text="${item.keyword}"></b>
                    </td>
                    <td>  <span th:text="${item.source}"></span> </td>
                    <td>  <span th:text="${item.views}"></span> </td>
                    <td>  <span th:text="${item.date}"></span> </td>
                </tr>
            </table>
    </div>
    <!-- end dd-wrapper -->
    <div class="layui-box layui-laypage layui-laypage-default pageBox">
        <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
    </div>

    <script type="text/javascript" src="/goods/Tips/Tips.min.js"></script>
    <script type="text/javascript">
        var layer;
        var $;
        var windowOpen;
        layui.use(['laydate', 'jquery', 'form', 'layer'], function () {
            var laydate = layui.laydate;
            $ = layui.jquery;
            var form = layui.form;
            layer = layui.layer;
            laydate.render({
                elem: '#date'
            });



            $(function () {
                $("#add_keyword").click(function(){
                    layer.open({
                        type: 2,
                        title: '添加流量来源',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['580px', '60%'],
                        content: '/tao/goods_traffic_add'
                    });
                })
            })
        });

    </script>

    <!-- 模板  -->
    <script type="text/template" id="tpl-group">
        <div class="T-box" style="width: 1000px">
            <div class="dd-log">
                <ul id="sendContext">
                </ul>
            </div>
        </div>
    </script>

    <script type="text/javascript" src="/sb/jquery.min.js"></script>

</div>
</body>
<html>
